#ifndef __FILEBMP_H__
#define __FILEBMP_H__

#define RGB_RED				0
#define RGB_GREEN			1
#define RGB_BLUE			2
#define RGB_SIZE			3

#define pixels2bytes(n)		((n+7)/8)

typedef HGLOBAL HFILEBITMAP;

typedef struct 
{
	char Name[16];
	char Comments[65];
	unsigned int Width, Depth, Bits;
	int Flags;
	int BackGround;
	long FileSize;
	long ImageSize;
	char Palette[768];
} BMPFILEINFO;

typedef struct
{
	char szBitmap[256];    
	BMPFILEINFO fi;
	HGLOBAL hImage;
	HANDLE hPalette;
	int nLineWidth;
	int nImageBits;
	int nPageDepth;
	HGLOBAL hDibInfo;
	HBRUSH hBrush;
} FILEBITMAP, FAR *LPFILEBITMAP;

#if defined( __cplusplus )
extern "C" {
#endif

HFILEBITMAP WINAPI BmpCreate(LPTSTR lpszPath);
BOOL WINAPI BmpPaint(HFILEBITMAP, HDC, RECT, BOOL, HBRUSH);
void WINAPI BmpDestroy(HFILEBITMAP);
BOOL WINAPI BmpGetSize(HFILEBITMAP, SIZE FAR *);
HBRUSH WINAPI BmpCreateBrush(HFILEBITMAP);
void WINAPI BmpDestroyBrush(HFILEBITMAP);
HPALETTE WINAPI BmpRealizePalette(HFILEBITMAP, HDC);

#if defined( __cplusplus )
}
#endif

#endif 
